<?php
require_once 'class/DataIn/AbstractDataIN.php';
require_once 'class/DataIn/AbstractDataIN.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Time
 *
 * @author mateusz.ledzewicz
 */
class Normal extends AbstractDataIN{
    protected $dataArray;
    protected $params;
    protected $days;
    protected $count;
    public function __construct($isin, $date, $type, $numberOfData, $days, $paramsArray, $offset=30, $currency=null) {
        $this->params = $paramsArray;
       
        $this->days = $days;
        $this->count = $numberOfData;
        parent::__construct($isin, $date, $type, $numberOfData+$days+$offset, $currency);
        
    }


    protected function prepareData() {
       
        $data = $this->getPreparedData();
        
        $this->dataArray = array_values($data);
        foreach($this->dataArray as $key => $line){
            if($key == 0) continue;
            if($key>$this->count)
                break;
            $inLine = array();
            for($i=0; $i<$this->days;$i++)
            {
                $inKey = $key + $i;
                foreach($this->params as $param)
                {
                    if($i > 0 && $param->param == Param::currency){
                        continue;
                    }
                    $inLine[] = $this->getIn($param, $inKey);
                }
                
                 
            }
            $this->data[] = $inLine; 
           
        }   
        
    }
}

?>
